home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / snip9_91.arc / TCDATE.C < prev    next >
C/C++ Source or Header  |  1991-09-17  |  650b  |  30 lines

  1. /* SHOWDATE.C
  2.  * Syntax: SHOWDATE filename
  3.  */
  4.  
  5. #include <dir.h>
  6. #include <io.h>
  7.  
  8. main(int argc, char *argv[])
  9. {
  10.     struct ffblk fb;
  11.     struct ftime *ft;
  12.  
  13.     /* Setup up ffblk */
  14.     if (argc < 2 ||
  15.         findfirst(argv[1],&fb,0))
  16.             exit();
  17.  
  18.     /* Map date & time into ftime structure using a typecast */
  19.     ft = (struct ftime *) &fb.ff_ftime;
  20.  
  21.     printf("Date: %02d-%02d-%02d   Time: %02d:%02d.%02d\n",
  22.         ft->ft_month,
  23.         ft->ft_day,
  24.         ft->ft_year+80,   /* Year - 1980 */
  25.         ft->ft_hour,
  26.         ft->ft_min,
  27.         ft->ft_tsec * 2); /* Seconds / 2 */
  28. }
  29. /* End of Program */
  30.